package com.demo.idempotent.controller;

import com.demo.idempotent.services.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    TestService testService;

    @GetMapping("/idem/{id}")
    public String test(@PathVariable String id) {
        String idem = testService.idemponment(id);
        String norm = testService.normal(id);
        return "norm:" + norm + ",\n" + "idem:" + idem;
    }


}
